package day013.string;

public class Test03 {
    public static void main(String[] args) {
        String str = "I love Java,I love Heima";

        int count1 = 0;
        char[] chars = str.toCharArray();
        for (int i = 0; i < chars.length; i++) {
            if (chars[i] == 'a') {
                count1++;
            }
        }
        System.out.println("字符a出现了" + count1 + "次");

        int count2 = 0;
        for (int i = 0; i < str.length(); i++) {
            if (str.charAt(i) == 'a') {
                count2++;
            }
        }
        System.out.println("字符a出现了" + count2 + "次");

        String s1 = str.toLowerCase();
        System.out.println(s1);

        String s2 = str.toUpperCase();
        System.out.println(s2);
    }
}
